﻿using ET.Monitor.DAL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ET.Monitor.Model
{
    public class CliqueModel
    {
        string id = "";
        DateTime st = new DateTime();
        DateTime et = new DateTime();
        int second = 0;
        public CliqueModel() { }
        public CliqueModel(string id) { this.id = id; }
        public CliqueModel(DateTime sTime, DateTime eTime)
        {
            st = sTime;
            et = eTime;
        }
        public CliqueModel(string id, DateTime sTime, DateTime eTime)
        {
            this.id = id;
            st = sTime;
            et = eTime;
        }
        public CliqueModel(string id, DateTime sTime, DateTime eTime, int second)
        {
            this.id = id;
            st = sTime;
            et = eTime;
            this.second = second;
        }

        CliqueDAL dal = new CliqueDAL();

        #region 总实时负荷
        object objPower;

        public object ObjPower
        {
            get
            {
                return dal.GetTotalPower(id);
            }

            set
            {
                objPower = value;
            }
        }

        #endregion

        #region 日发电量
        double dayDL;
        public double DayDL
        {
            get
            {
                return dal.GetDL(st, et);
            }

            set
            {
                dayDL = value;
            }
        }

        #endregion

        #region  年发电量
        double yearDL;
        public double YearDL
        {
            get
            {
                return dal.GetDL(st, et);
            }

            set
            {
                yearDL = value;
            }
        }

        #endregion


        #region 月
        DataTable dtTotalMonthDL;

        public DataTable DtTotalMonthDL
        {
            get
            {
                return dal.GetStationMonthTotalDLByTime(st, et);
            }

            set
            {
                dtTotalMonthDL = value;
            }
        }
        #endregion

        #region 节省标煤量
        double bml;
        public double Bml
        {
            get
            {
                return dal.GetSumBML(id);
            }

            set
            {
                bml = value;
            }
        }

        #endregion

        #region 累计容量
        double sumRL;
        public double SumRL
        {
            get
            {
                return dal.GetSumRL();
            }

            set
            {
                sumRL = value;
            }
        }
        #endregion

        #region  累计总发电量
        double dlSumDL;

        public double DlSumDL
        {
            get
            {
                return dal.GetSumDL(id);
            }

            set
            {
                dlSumDL = value;
            }
        }
        #endregion

        #region 负荷趋势
        double[] line;


        public double[] Line
        {
            get
            {
                return dal.GetPowerLine(id, st, et, second);
            }

            set
            {
                line = value;
            }
        }


        #endregion

        #region 电量统计
        DataTable dtDLYearTotal;
        public DataTable DtDLYearTotal
        {
            get
            {
                return dal.GetYearTotalDLByTime(st, et);
            }

            set
            {
                dtDLYearTotal = value;
            }
        }
        DataTable dtDLMonthTotal;

        public DataTable DtDLMonthTotal
        {
            get
            {
                return dal.GetMonthTotalDLByTime(st, et);
            }

            set
            {
                dtDLMonthTotal = value;
            }
        }
        DataTable dtDLDayTotal;
        public DataTable DtDLDayTotal
        {
            get
            {
                return dal.GetDayTotalDLByTime(st, et);
            }

            set
            {
                dtDLDayTotal = value;
            }
        }
        DataTable dtDLHourTotal;
        public DataTable DtDLHourTotal
        {
            get
            {
                return dal.GetHourTotalDLByTime(st, et);
            }

            set
            {
                dtDLHourTotal = value;
            }
        }
        #endregion
    }
}
